#!/usr/bin/env python
# -*- coding: utf8 -*-

'''
Created on 2011-8-2

@author: zhongfeng
'''

from gomepageparser import GomeAllSortParser,GomeSort3PageParser,GomeSort4PageParser
from pageparser import ObuyUrlSummary
from spider import ObuySpider

if __name__ == '__main__':

    parserDict = {0:GomeAllSortParser,3:GomeSort3PageParser,4:GomeSort4PageParser}
    
    sort3 = ObuyUrlSummary(url = r'http://www.gome.com.cn/products/10000000-10000012-10000070.html',name='gome',  
                                 isRecursed = True,catagoryLevel = 3)
    
    digitRoot = ObuyUrlSummary(url = r'http://www.gome.com.cn/products/10000000-10000012-10000070-0-0-0-0-0-0-0-1-1-3.html', 
                               name='手机',catagoryLevel = 4)
    
    newEggRoot = ObuyUrlSummary(url = r'http://www.gome.com.cn/allSort.html',name='gome',  
                                 isRecursed = True,catagoryLevel = 0)

    pserver  = ObuyUrlSummary(url = r'http://www.gome.com.cn/tv.html', 
                               name='电视',catagoryLevel = 1)
    
    spider = ObuySpider(rootUrlSummary = newEggRoot,parserDict = parserDict,include = None,exclude = None,threadNum = 5)
    spider.spide()